package com.lpc.activitytest;

import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.os.SystemClock;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;

/**
 * 功能:
 * <p>
 * 描述:
 * <p>
 * Created by lipc0113 on 2018/7/16.
 */
public class FiveActivity extends AppCompatActivity {

    private Handler handler = new Handler(){
        @Override
        public void handleMessage(Message msg) {
            super.handleMessage(msg);

            SystemClock.sleep(1000 * 1000);
        }
    };

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_five);

        Log.e("lipc0113", "onCreate " + getTaskId());
    }

    public void click(View view) {

        new Thread() {
            @Override
            public void run() {
                super.run();

                SystemClock.sleep(1000 * 1000);
            }
        }.start();

        Message m = Message.obtain();
        handler.sendEmptyMessageDelayed(0, 1000 * 1000);
    }
}
